package com.xiangyang.controller;
import com.xiangyang.entity.PatientRegistration;
import com.xiangyang.entity.Patients;
import com.xiangyang.entity.Prescription;
import com.xiangyang.entity.dto.Result;
import com.xiangyang.service.IRegistrationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/Prescription")
@CrossOrigin
public class PrescriptionController {
    @Autowired
    private IRegistrationService registrationService;
    @PostMapping ("/addPrescription")
    public Result addPrescription(@RequestBody PatientRegistration patients) {
        return registrationService.addPrescription(patients);
    }//新增处方
    @GetMapping("/getPrescription")
    public Result getPrescription(Long caseHistoryId) {
        return registrationService.getprescription(caseHistoryId);
    }//查询某一个处方
}
